import 'package:get/get.dart';
import 'package:share_fit/app/helper/ext/tr_ext.dart';
import 'package:share_fit/app/models/home/edit_widget_item.dart';
import 'package:share_fit/app/models/home/heart_rate_model.dart';
import 'package:share_fit/app/models/home/menstrual_mode.dart';
import 'package:share_fit/app/models/home/sleep_model.dart';
import 'package:share_fit/app/models/home/spo2_model.dart';
import 'package:share_fit/app/models/home/step_model.dart';
import 'package:share_fit/app/models/home/stress_model.dart';
import 'package:share_fit/app/models/home/workout_model.dart';
import 'package:share_fit/app/routes/home_routes.dart';
import 'package:share_fit/generated/locales.g.dart';

class HomeState {
  List<EditWidgetItem> hasList = [];
  List defaultWidgetList = [];

  TodaySummary todaySummary = TodaySummary();

  /// 当天最新的一条运动记录
  WorkoutSummaryItem todayWorkout = WorkoutSummaryItem('', []);
  SleepSummary sleepSummary = SleepSummary();
  StressModel stressSummary = StressModel();
  MenstrualModel menstrualSummary = MenstrualModel(false);
  HRSummary hrSummary = HRSummary();
  HRSummary hrAvg = HRSummary();
  Spo2Summary spo2Summary = Spo2Summary();
  Spo2Summary spo2Avg = Spo2Summary();

  HomeState() {
    ///Initialize variables

    defaultWidgetList.add({
      'type': Type.heartRate.code,
      'width': 1.0,
      'height': 1.0,
      'action': 'remove',
      'title': LocaleKeys.widgets_heart_rate.ts,
      'image': 'assets/images/home/heart.png',
      'route': '/home/heartRate/records'
    });
    defaultWidgetList.add({
      'type': Type.bloodOxygen.code,
      'width': 1.0,
      'height': 1.0,
      'action': 'remove',
      'title': LocaleKeys.widgets_blood_oxygen.ts,
      'image': 'assets/images/home/spo2.png',
      'route': '/home/spo2/records',
    });
    defaultWidgetList.add({
      'type': Type.sleep.code,
      'width': 1.0,
      'height': 1.0,
      'action': 'remove',
      'title': LocaleKeys.widgets_sleep.ts,
      'image': 'assets/images/home/sleep.png',
      'route': '/home/sleep/records',
    });
    defaultWidgetList.add({
      'type': Type.cycleCalendar.code,
      'width': 1.0,
      'height': 1.0,
      'action': 'remove',
      'title': LocaleKeys.widgets_cycle_calendar.ts,
      'image': 'assets/images/home/menstrual.png',
      'route': HomeRoutes.cycleCalendarPage,
    });
    defaultWidgetList.add({
      'type': Type.stress.code,
      'width': 1.0,
      'height': 1.0,
      'action': 'remove',
      'title': LocaleKeys.widgets_stress.ts,
      'image': 'assets/images/home/stress.png',
      'route': HomeRoutes.stressRecordsPage,
    });
  }
}
